package com.yc.structuralType.proxy;

/**
 * 代理类
 *
 */
public class SubjectProxy implements Subject {

    private Subject realSubject = new RealSubject();

    public void display() {
        preRequest();
        realSubject.display();
        postRequest();

    }

    public void preRequest() {
        System.out.println("代理开始执行");
    }

    public void postRequest() {
        System.out.println("代理执行结束");
    }
}
